package shared;

import java.util.ArrayList;

import log.Log;

public class Friend
{
	private String name, surname, id, gender, birthplace, currentplace, age, school, work;
	private ArrayList<String> friends = new ArrayList<String>();
	private ArrayList<Pair<String, String>> familyMembers = new ArrayList<Pair<String, String>>();
	private ArrayList<String> workMembers = new ArrayList<String>();
	private ArrayList<String> mutualFriends = new ArrayList<String>();
	
	public Friend(String _name, String _surname, String _id)
	{
		this(_name, _surname, _id, "", "", "", "", "", "");
	}
	
	public Friend(String _name, String _surname, String _id, String _gender, String _birthplace, String _currentplace, String _age)
	{		
		this(_name, _surname, _id, _gender, _birthplace, _currentplace, _age, "", "");
	}
	
	public Friend(String _name, String _surname, String _id, String _gender, String _birthplace, String _currentplace, String _age,  String _school, String _work)
	{
		this.setName(_name);
		this.setSurname(_surname);
		this.setId(_id);
		this.setGender(_gender);
		this.setBirthplace(_birthplace);
		this.setCurrentplace(_currentplace);
		this.setAge(_age);
		this.setSchool(_school);
		this.setWork(_work);
	}


	/**
	 * This method creates string of all available data before writing to database
	 * how to use in query string: "Insert into TABLE values("+Friend.toString()+")"
	 */
	@Override
	public String toString()
	{
		return (getId() + "," + getName() + "," + getSurname()  +  "," + getGender() + "," + getBirthplace() + "," + getCurrentplace() + "," +  getAge());
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		if(name == null)
			this.name = "";
		else
			this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		if(surname == null)
			this.surname = "";
		else
			this.surname = surname;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		if(age == null)
			this.age = "";
		else
			this.age = age;
	}

	public String getCurrentplace() {
		return currentplace;
	}

	public void setCurrentplace(String currentplace) {
		if(currentplace == null)
			this.currentplace = "";
		else
			this.currentplace = currentplace;
	}

	public String getBirthplace() {
		return birthplace;
	}

	public void setBirthplace(String birthplace) {
		if(birthplace == null)
			this.birthplace = "";
		else
			this.birthplace = birthplace;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		if(gender == null)
			this.gender = "";
		else
			this.gender = gender;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		if(id == null)
			this.id = "";
		else
			this.id = id;
	}
	

	public String getSchool() {
		return school;
	}

	public void setSchool(String school) {
		if(school == null)
			this.school = "";
		else
			this.school = school;
	}

	public String getWork() {
		return work;
	}

	public void setWork(String work) {
		if(work == null)
			this.work = "";
		else
			this.work = work;
	}

	public ArrayList<String> getFriends() {
		return friends;
	}

	public void setFriends(ArrayList<String> friends) {
		this.friends = friends;
	}

	public ArrayList<Pair<String, String>> getFamilyMembers() {
		return familyMembers;
	}

	public void setFamilyMembers(ArrayList<Pair<String, String>> familyMembers) {
		this.familyMembers = familyMembers;
	}

	public ArrayList<String> getWorkMembers() {
		return workMembers;
	}

	public void setWorkMembers(ArrayList<String> workMembers) {
		this.workMembers = workMembers;
	}

	public ArrayList<String> getMutualFriends() {
		return mutualFriends;
	}

	public void setMutualFriends(ArrayList<String> mutualFriends) {
		this.mutualFriends = mutualFriends;
	}


}